package com.itheima.reggie.common;

import com.itheima.reggie.domain.Employee;

//ThreadLocal操作工具类
//名称以Holder结尾的文件一般是和ThreaLocal 拦截器配合做信息共享的
public class EmployeeHolder {


    //声明ThreadLocal对象
    private static ThreadLocal<Employee> th = new ThreadLocal<Employee>();

    //存储Employee
    public static void set(Employee employee) {
        th.set(employee);
    }

    //获取Employee
    public static Employee get() {
        return th.get();
    }

    //移除Employee
    public static void remove() {
        th.remove();
    }
}